package com.lwp.test.myevent.event;


import org.springframework.core.ResolvableType;

public class MyEvent1 extends MyEvent {

    /**
     * Constructs a prototypical Event.
     *
     * @param source The object on which the Event initially occurred.
     * @throws IllegalArgumentException if source is null.
     */
    public MyEvent1(Object source) {
        super(source);
    }

    public static void main(String[] args) {
        MyEvent myEvent1 = new MyEvent1("111");
        MyEvent myEvent = new MyEvent("111");
        System.out.println(myEvent1.getSource());
        System.out.println(myEvent1.getClass().getTypeName());
        System.out.println(myEvent1.getClass().getSuperclass().getTypeName());
        if (myEvent1.getClass().getSuperclass() == MyEvent.class) {
            System.out.println("相同");
        }

        System.out.println(myEvent.getSource());
        System.out.println(myEvent.getClass().getTypeName());
        System.out.println(myEvent.getClass().getSuperclass().getTypeName());

        ResolvableType resolvableType = ResolvableType.forInstance(myEvent1);
        System.out.println(resolvableType.getType().getTypeName());
        System.out.println(resolvableType.getSuperType().getType().getTypeName());
    }

}
